package com.zhoug.mpchart.core.styleconfig;

import com.github.mikephil.charting.model.GradientColor;
import com.zhoug.mpchart.core.MPConstant;

import java.util.List;

/**
 * @Author: zhoug
 * @Date: 2024-02-04
 * @Description:
 */
public class MPCombinedStyleConfig extends MPStyleConfig implements IMPCombinedStyleConfig {
    ////默认为柱状图 mpBarLineKeys属性为null时生效
    private @MPConstant.ChartType
    int defaultChartType = MPConstant.BAR_CHART;
    private MPBarStyleConfig mBarStyleConfig = new MPBarStyleConfig();
    private MPLineStyleConfig mLineStyleConfig = new MPLineStyleConfig();

    @Override
    public int getDefaultChartType() {
        return defaultChartType;
    }

    @Override
    public void setDefaultChartType(@MPConstant.ChartType int defaultChartType) {
        this.defaultChartType = defaultChartType;
    }

    @Override
    public void setBarColors(int[] barColors) {
        mBarStyleConfig.setBarColors(barColors);
    }

    @Override
    public void setGradientColors(List<GradientColor> gradientColors) {
        mBarStyleConfig.setGradientColors(gradientColors);
    }

    @Override
    public void setStackBar(boolean stackBar) {
        mBarStyleConfig.setStackBar(stackBar);
    }

    /**
     * 重叠
     *
     * @param overlap
     */
    @Override
    public void setOverlap(boolean overlap) {
        mBarStyleConfig.setOverlap(overlap);
    }

    /**
     * 重叠
     */
    @Override
    public boolean isOverlap() {
        return mBarStyleConfig.isOverlap();
    }

    @Override
    public void setBarWidth(float barWidth) {
        mBarStyleConfig.setBarWidth(barWidth);

    }

    @Override
    public void setGroupSpace(float groupSpace) {
        mBarStyleConfig.setGroupSpace(groupSpace);

    }

    @Override
    public void setBarSpace(float barSpace) {
        mBarStyleConfig.setBarSpace(barSpace);

    }

    @Override
    public void setSpaceIsPercent(boolean spaceIsPercent) {
        mBarStyleConfig.setSpaceIsPercent(spaceIsPercent);

    }

    @Override
    public int[] getBarColors() {
        return mBarStyleConfig.getBarColors();
    }

    @Override
    public List<GradientColor> getGradientColors() {
        return mBarStyleConfig.getGradientColors();

    }

    @Override
    public boolean isStackBar() {
        return mBarStyleConfig.isStackBar();

    }

    @Override
    public float getBarWidth() {
        return mBarStyleConfig.getBarWidth();

    }

    @Override
    public float getGroupSpace() {
        return mBarStyleConfig.getGroupSpace();

    }

    @Override
    public float getBarSpace() {
        return mBarStyleConfig.getBarSpace();
    }

    @Override
    public boolean isSpaceIsPercent() {
        return mBarStyleConfig.isSpaceIsPercent();

    }

    @Override
    public int getBarColor(int index) {
        return mBarStyleConfig.getBarColor(index);
    }

    @Override
    public GradientColor getBarGradientColor(int index) {
        return mBarStyleConfig.getBarGradientColor(index);
    }

    @Override
    public void setLineColors(int[] lineColors) {
        mLineStyleConfig.setLineColors(lineColors);

    }

    @Override
    public int[] getLineColors() {
        return mLineStyleConfig.getLineColors();
    }

    @Override
    public int getLineColor(int index) {
        return mLineStyleConfig.getLineColor(index);
    }

    @Override
    public void setLineAttachAxis(boolean attachAxis) {
        mLineStyleConfig.setLineAttachAxis(attachAxis);
    }

    @Override
    public boolean isLineAttachAxis() {
        return mLineStyleConfig.isLineAttachAxis();
    }

}
